Equivalent of `__FILE__`, `__LINE__` in bash

Posted by bibop554 on Stack Overflow See other posts from Stack Overflow or by bibop554
Published on 2010-06-16T17:36:41Z Indexed on 2010/06/16 17:52 UTC
Read the original article Hit count: 269

Filed under:
|
|

Is there any variable in bash that contains the name of the .sh file executed ?
The line number would be great too.

I want to use it in error messages such as:
echo "ERROR: [$FILE:L$LINE] $somefile not found"

Thank you

© Stack Overflow or respective owner

Related posts about bash

Related posts about macros